//
//  RegistView.m
//  UIProject-A
//
//  Created by lanou3g on 15/7/16.
//  Copyright (c) 2015年 何 旭. All rights reserved.
//

#import "RegistView.h"
#import "LTView.h"
@implementation RegistView

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        NSArray *labelTextArray = @[@"用户名",@"密码",@"确认密码",@"邮箱",@"联系方式"];
        NSArray *pArray = @[@"请输入用户名",@"请输入密码",@"请确认密码",@"请输入邮箱",@"请输入联系方式"];
        for (int i = 0; i < 5 ; i ++) {
            LTView *ltView = [[LTView alloc] initWithFrame:CGRectMake(50, 100 + 50 * i, 300, 35)];
            ltView.Label.text = labelTextArray[i];
            ltView.TextField.placeholder = pArray[i];
            ltView.TextField.borderStyle = UITextBorderStyleRoundedRect;
            ltView.tag = 1000 + i;
            [self addSubview:ltView];
         
            if (1 == i||2 == i) {
                ltView.TextField.secureTextEntry = YES;
            }
            
            if (4 == i) {
               ltView.TextField.keyboardType = UIKeyboardTypeNumberPad;
            }
           
        }
            self.usernameView = (LTView *)[self viewWithTag:1000];
            self.passwordView = (LTView *)[self viewWithTag:1001];
            self.passwordsureView = (LTView *)[self viewWithTag:1002];
            self.mailLTView = (LTView *)[self viewWithTag:1003];
            self.phoneLTView = (LTView *)[self viewWithTag:1004];
        
            
            
            
            NSArray *buttonTitleArray = @[@"确定",@"取消"];
            for (int i = 0; i < 2 ; i ++) {
                UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
                button.frame = CGRectMake(100 + 100 * i, 350, 80, 40);
                [button setTitle:buttonTitleArray[i] forState:UIControlStateNormal];
                button.tag = 2000 + i;
                [self addSubview:button];
            }
            self.sureButton = (UIButton *)[self viewWithTag:2000];
            self.cancelButton = (UIButton *)[self viewWithTag:2001];
        
    }
    return self;
}










/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
